using System;
using System.Data;
using Utils.DatabaseUtils;
using Utils;


namespace DCSLibrary
{
public class SupportUI
{ 
	private int supportID;
	public int SupportID
	{
		get { return supportID;}
		set { supportID = value;}
	}

	private int categoryPageID;
	public int CategoryPageID
	{
		get { return categoryPageID;}
		set { categoryPageID = value;}
	}

	private String location;
	public String Location
	{
		get { return location;}
		set { location = value;}
	}

	private String supporter;
	public String Supporter
	{
		get { return supporter;}
		set { supporter = value;}
	}

	private String tel;
	public String Tel
	{
		get { return tel;}
		set { tel = value;}
	}

	private String yM;
	public String YM
	{
		get { return yM;}
		set { yM = value;}
	}

	private String sky;
	public String Sky
	{
		get { return sky;}
		set { sky = value;}
	}

	private String viewOrder;
	public String ViewOrder
	{
		get { return viewOrder;}
		set { viewOrder = value;}
	}

	public SupportUI() {}

	public SupportUI(int supportID, int categoryPageID, String location, String supporter, String tel, String yM, String sky, String viewOrder)
	 {
		this.supportID = supportID;
 		this.categoryPageID = categoryPageID;
 		this.location = location;
 		this.supporter = supporter;
 		this.tel = tel;
 		this.yM = yM;
 		this.sky = sky;
 		this.viewOrder = viewOrder;
 	}

	public int Add(int categoryPageID, String location, String supporter, String tel, String yM, String sky, String viewOrder)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"Support_Add",categoryPageID,location,supporter,tel,yM,sky,viewOrder);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int Update(int supportID, int categoryPageID, String location, String supporter, String tel, String yM, String sky, int viewOrder)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"Support_Update",supportID,categoryPageID,location,supporter,tel,yM,sky,viewOrder);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int Delete(int supportID)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"Support_Delete",supportID);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int DeleteAll()
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"Support_DeleteAll");
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public DataSet Get(int supportID)
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"Support_Get",supportID);
			return result;
		}
		catch(Exception e) {return null; }
	}

	public DataSet GetAll()
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"Support_GetAll");
			return result;
		}
		catch(Exception e) {return null; }
	}

} 
}
